package org.example.java8.datetime;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.ZoneId;

public class Test {

	public static void main(String[] args) {
		
		LocalDateTime localDateTime = LocalDateTime.now();
		System.out.println(localDateTime);
		System.out.println(localDateTime.toLocalDate());
		System.out.println(localDateTime.toLocalTime());
		LocalDate localDate = LocalDate.now();
		System.out.println(localDate);
		
		Month month = localDate.getMonth();
		int dayOfMonth = localDate.getDayOfMonth();
		int year = localDate.getYear();
		System.out.println(year + "年" + month + "月" + dayOfMonth + "日");
		
		DayOfWeek dayOfWeek = localDate.getDayOfWeek();
		System.out.println("星期" +dayOfWeek.getValue());
		
//		String dateTimeString = "2024-05-09T10:28:22.401092900";
//		
//		ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateTimeString);
//		System.out.println(zonedDateTime);
		ZoneId zoneId = ZoneId.systemDefault();
		System.out.println(zoneId);
	}

}
